<!-- 车辆维护 -->
<template>
  <view class="content">
    <u-form :model="form" ref="uForm" :label-width="240">
      <view class="card-box">
        <view class="u-flex"
          >行驶证<view class="card-icon-box">
            <view></view>
            <view></view> </view
        ></view>
        <view class="u-flex top-box">
          <u-form-item class="width-50" label-position="top">
            <u-upload
              :upload-text="'添加车头行驶证'"
              :width="325"
              :height="240"
              :custom-btn="true"
              :deletable="
                auditStatus == null || auditStatus == '2' ? true : false
              "
              class="uUpload-box"
              ref="uUpload1"
              :action="uploadUrl"
              @on-success="headLicensesuccess"
              @on-remove="headLicenseremove"
              @on-error="testerror"
              :show-progress="form.headLicensePic ? false : true"
              max-count="1"
              :form-data="uploaderData1"
            >
              <view
                slot="addBtn"
                class="slot-btn"
                hover-class="slot-btn__hover"
                hover-stay-time="150"
              >
                <image class="slot-img" src="../../static/end.png" />
                <view class="slot-name">添加车头行驶证</view>
              </view>
            </u-upload>
            <image
              v-if="headLicense"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 10rpx;
              "
            />
            <div
              v-if="
                headLicenseRemoveFlag &&
                form.headLicensePic &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('车头行驶证')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
            </div>
            <div
              v-if="
                headLicenseRemoveFlag &&
                form.headLicensePic &&
                auditStatus != null &&
                auditStatus == '0'
              "
              class="toexamine-box"
            >
              <image
                :src="uploadIconList[3].icon"
                style="
                  width: 98rpx;
                  height: 96rpx;
                  display: inline;
                  position: absolute;
                  bottom: 142rpx;
                  left: 0rpx;
                "
              />
            </div>
          </u-form-item>
          <u-form-item class="width-50" label-position="top">
            <u-upload
              :deletable="
                auditStatus == null || auditStatus == '2' ? true : false
              "
              :upload-text="'添加挂车行驶证'"
              :width="325"
              :height="240"
              :custom-btn="true"
              class="uUpload-box"
              ref="uUpload2"
              :action="uploadUrl"
              @on-success="attachLicensesuccess"
              @on-remove="attachLicenseremove"
              @on-error="testerror"
              :show-progress="form.attachLicensePic ? false : true"
              max-count="1"
              :form-data="uploaderData2"
              ><view
                slot="addBtn"
                class="slot-btn"
                hover-class="slot-btn__hover"
                hover-stay-time="150"
              >
                <image class="slot-img" src="../../static/front.png" />
                <view class="slot-name">添加挂车行驶证</view>
              </view></u-upload
            >
            <image
              v-if="attachLicenseEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 20rpx;
              "
            />
            <div
              v-if="
                attachLicenseRemoveFlag &&
                form.attachLicensePic &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('挂车行驶证')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
            </div>
            <div
              v-if="
                attachLicenseRemoveFlag &&
                form.attachLicensePic &&
                auditStatus != null &&
                auditStatus == '0'
              "
              class="toexamine-box"
            >
              <image
                :src="uploadIconList[3].icon"
                style="
                  width: 98rpx;
                  height: 96rpx;
                  display: inline;
                  position: absolute;
                  bottom: 142rpx;
                  left: 0rpx;
                "
              />
            </div>
          </u-form-item>
        </view>
        <u-form-item
          label="车头车牌号"
          ref="headNo"
          prop="headNo"
          class="form-item-box"
          required
        >
          <u-input
            v-model="form.headNo"
            maxlength="8"
            placeholder="请输入车头车牌号"
            @on-blur="upperCase"
            :disabled="auditStatus == null || auditStatus == '2' ? false : true"
          />
        </u-form-item>
        <u-form-item
          label="挂车车牌号"
          prop="attachNo"
          ref="attachNo"
          class="form-item-box"
          required
        >
          <u-input
            v-model="form.attachNo"
            maxlength="8"
            placeholder="请输入挂车车牌号"
            @on-blur="upperCase"
            :disabled="auditStatus == null || auditStatus == '2' ? false : true"
          />
        </u-form-item>
        <u-form-item
          label="车头行驶证注册时间"
          prop="headLicenseRegisterAt"
          ref="headLicenseRegisterAt"
          class="form-item-box"
          label-width="318"
          required
        >
          <u-input
            type="select"
            v-model="form.headLicenseRegisterAt"
            @click="
              {
                if (auditStatus == null || auditStatus == '2')
                  headLicenseRegisterAtShow = true
              }
            "
            placeholder="请选择车头行驶证注册时间"
          />
          <u-picker
            v-model="headLicenseRegisterAtShow"
            mode="time"
            @confirm="handleheadLicenseRegisterAtConfirm"
            :default-time="form.headLicenseRegisterAt"
            :show-time-tag="false"
          ></u-picker>
        </u-form-item>
      </view>
      <view class="card-box">
        <view class="u-flex"
          >道路运输证<view class="card-icon-box">
            <view></view>
            <view></view> </view
        ></view>
        <view class="u-flex top-box">
          <u-form-item class="width-50" label-position="top">
            <u-upload
              :deletable="
                auditStatus == null || auditStatus == '2' ? true : false
              "
              :custom-btn="true"
              :upload-text="'添加车头运输证'"
              :width="325"
              :height="240"
              ref="uUpload3"
              :action="uploadUrl1"
              @on-success="headTranssuccess"
              @on-remove="headTransremove"
              @on-error="testerror"
              :show-progress="form.headTransPic ? false : true"
              max-count="1"
              :form-data="uploaderData"
              ><view
                slot="addBtn"
                class="slot-btn"
                hover-class="slot-btn__hover"
                hover-stay-time="150"
              >
                <image class="slot-img" src="../../static/driver-auth1.png" />
                <view class="slot-name">添加车头运输证</view>
              </view>
            </u-upload>
            <image
              v-if="headTransEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 20rpx;
              "
            />
            <div
              v-if="
                headTransRemoveFlag &&
                form.headTransPic &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('车头运输证')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
            </div>
            <div
              v-if="
                headTransRemoveFlag &&
                form.headTransPic &&
                auditStatus != null &&
                auditStatus == '0'
              "
              class="toexamine-box"
            >
              <image
                :src="uploadIconList[3].icon"
                style="
                  width: 98rpx;
                  height: 96rpx;
                  display: inline;
                  position: absolute;
                  bottom: 142rpx;
                  left: 0rpx;
                "
              />
            </div>
          </u-form-item>
          <u-form-item class="width-50" label-position="top">
            <u-upload
              :deletable="
                auditStatus == null || auditStatus == '2' ? true : false
              "
              :upload-text="'添加挂车运输证'"
              :width="325"
              :height="240"
              ref="uUpload4"
              :custom-btn="true"
              :action="uploadUrl1"
              @on-success="attachTranssuccess"
              @on-remove="attachTransremove"
              @on-error="testerror"
              :show-progress="form.attachTransPic ? false : true"
              max-count="1"
              :form-data="uploaderData"
            >
              <view
                slot="addBtn"
                class="slot-btn"
                hover-class="slot-btn__hover"
                hover-stay-time="150"
              >
                <image class="slot-img" src="../../static/driver-auth2.png" />
                <view class="slot-name">添加挂车运输证</view>
              </view>
            </u-upload>
            <image
              v-if="attachTransEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 20rpx;
              "
            />
            <div
              v-if="
                attachTransRemoveFlag &&
                form.attachTransPic &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('挂车运输证')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
            </div>
            <div
              v-if="
                attachTransRemoveFlag &&
                form.attachTransPic &&
                auditStatus != null &&
                auditStatus == '0'
              "
              class="toexamine-box"
            >
              <image
                :src="uploadIconList[3].icon"
                style="
                  width: 98rpx;
                  height: 96rpx;
                  display: inline;
                  position: absolute;
                  bottom: 142rpx;
                  left: 0rpx;
                "
              />
            </div>
          </u-form-item>
        </view>
        <u-form-item
          label="车头道路运输经营许可证"
          label-width="318"
          ref="headTransNo"
          prop="headTransNo"
          class="form-item-box"
          required
        >
          <u-input
            type="number"
            v-model="form.headTransNo"
            :maxlength="12"
            :disabled="
              auditStatus == '2' || auditStatus === null ? false : true
            "
            placeholder="请输入经营许可证号"
            @on-blur="upperCase"
          />
        </u-form-item>
        <u-form-item
          label="道路运输证签发机关"
          class="form-item-box"
          required
          prop="headTransSignName"
          label-width="280"
        >
          <u-input
            v-model="form.headTransSignName"
            type="select"
            @click="
              if (auditStatus == '2' || auditStatus === null)
                headTransSignCodeShow = true
            "
            placeholder="请选择道路运输证签发机关"
          />
          <u-picker
            mode="region"
            v-model="headTransSignCodeShow"
            @confirm="pickerRegionSelect"
            @cancel="pickerRegionCancelSelect"
          ></u-picker>
        </u-form-item>
      </view>
      <view class="card-box">
        <view class="u-flex"
          >附属资料<view class="card-icon-box">
            <view></view>
            <view></view> </view
        ></view>
        <div class="u-flex top-box">
          <u-form-item class="width-50" label-position="top">
            <u-upload
              :deletable="
                auditStatus == null || auditStatus == '2' ? true : false
              "
              :upload-text="'添加环保清单'"
              :width="325"
              :height="240"
              :custom-btn="true"
              ref="uUpload5"
              :action="uploadUrl1"
              @on-success="eProtectionSheetsuccess"
              @on-remove="eProtectionSheetremove"
              @on-error="testerror"
              :show-progress="form.environPic ? false : true"
              max-count="1"
              :form-data="uploaderData"
            >
              <view
                slot="addBtn"
                class="slot-btn"
                hover-class="slot-btn__hover"
                hover-stay-time="150"
              >
                <image class="slot-img" src="../../static/driver-auth1.png" />
                <view class="slot-name">添加环保清单</view>
              </view></u-upload
            >
            <image
              v-if="eProtectionSheetEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 20rpx;
              "
            />
            <div
              v-if="
                eProtectionSheetRemoveFlag &&
                form.environPic &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('环保清单')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
            </div>
            <div
              v-if="
                eProtectionSheetRemoveFlag &&
                form.environPic &&
                auditStatus != null &&
                auditStatus == '0'
              "
              class="toexamine-box"
            >
              <image
                :src="uploadIconList[3].icon"
                style="
                  width: 98rpx;
                  height: 96rpx;
                  display: inline;
                  position: absolute;
                  bottom: 142rpx;
                  left: 0rpx;
                "
              />
            </div>
          </u-form-item>
          <u-form-item class="width-50" label-position="top">
            <u-upload
              :deletable="
                auditStatus == null || auditStatus == '2' ? true : false
              "
              :upload-text="'添加车辆照片'"
              :width="325"
              :height="240"
              :custom-btn="true"
              ref="uUpload6"
              :action="uploadUrl1"
              @on-success="carPhotosuccess"
              @on-remove="carPhotoremove"
              @on-error="testerror"
              :show-progress="form.carPic ? false : true"
              max-count="1"
              :form-data="uploaderData"
            >
              <view
                slot="addBtn"
                class="slot-btn"
                hover-class="slot-btn__hover"
                hover-stay-time="150"
              >
                <image class="slot-img" src="../../static/driver-auth2.png" />
                <view class="slot-name">添加车辆照片</view>
              </view>
            </u-upload>
            <image
              v-if="carPhotoEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 20rpx;
              "
            />
            <div
              v-if="
                carPhotoRemoveFlag &&
                form.carPic &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('车辆照片')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
            </div>
            <div
              v-if="
                carPhotoRemoveFlag &&
                form.carPic &&
                auditStatus != null &&
                auditStatus == '0'
              "
              class="toexamine-box"
            >
              <image
                :src="uploadIconList[3].icon"
                style="
                  width: 98rpx;
                  height: 96rpx;
                  display: inline;
                  position: absolute;
                  bottom: 142rpx;
                  left: 0rpx;
                "
              />
            </div>
          </u-form-item>
        </div>
        <u-form-item
          prop="carEmissionLabel"
          label="排放标准"
          class="form-item-box"
          required
        >
          <u-input
            v-model="form.carEmissionLabel"
            type="select"
            @click="
              if (auditStatus == null || auditStatus == '2')
                carEmissionStandard = true
            "
            placeholder="请选择排放标准"
          />
          <u-select
            v-model="carEmissionStandard"
            mode="single-column"
            :list="carEmissionStandardList"
            @confirm="CarDischargeConfirm"
          ></u-select>
        </u-form-item>
        <u-form-item
          label="车牌颜色"
          class="form-item-box"
          required
          prop="carPlateColorLabel"
        >
          <u-input
            v-model="form.carPlateColorLabel"
            type="select"
            @click="
              {
                if (auditStatus == null || auditStatus == '2')
                  carLicensePlateColor = true
              }
            "
            placeholder="请选择车牌颜色"
          />
          <u-select
            v-model="carLicensePlateColor"
            mode="single-column"
            :list="carLicensePlateColorList"
            @confirm="carLicensePlateColorConfirm"
          ></u-select>
        </u-form-item>
        <u-form-item
          label="车辆类型"
          class="form-item-box"
          required
          prop="carTypeLabel"
        >
          <u-input
            v-model="form.carTypeLabel"
            type="select"
            @click="
              {
                if (auditStatus == null || auditStatus == '2')
                  carTypeShow = true
              }
            "
            placeholder="请选择车辆类型"
          />
          <u-select
            v-model="carTypeShow"
            mode="single-column"
            :list="carTypeList"
            @confirm="carTypeListConfirm"
          ></u-select>
        </u-form-item>
        <u-form-item
          label="车辆车长"
          class="form-item-box"
          required
          prop="carLengthLabel"
        >
          <u-input
            v-model="form.carLengthLabel"
            type="select"
            @click="
              {
                if (auditStatus == null || auditStatus == '2')
                  carLengthShow = true
              }
            "
            placeholder="请选择车辆车长"
          />
          <u-select
            v-model="carLengthShow"
            mode="single-column"
            :list="carLengthList"
            @confirm="carLengrhListConfirm"
          ></u-select>
        </u-form-item>
        <u-form-item
          label="核定载重"
          prop="carWeight"
          class="form-item-box"
          required
        >
          <view
            style="
              display: flex;
              align-items: center;
              justify-content: space-between;
              width: 100%;
            "
          >
            <input
              placeholder-style="color: #c0c4cc;"
              style="height: 100%"
              type="digit"
              :disabled="
                auditStatus == '2' || auditStatus === null ? false : true
              "
              v-model="form.carWeight"
              placeholder="请输入核定载重"
            />
            <text>吨</text>
          </view>
        </u-form-item>
        <u-form-item
          label="车辆颜色"
          class="form-item-box"
          required
          prop="carBodyColorLabel"
        >
          <u-input
            v-model="form.carBodyColorLabel"
            type="select"
            @click="
              {
                if (auditStatus == null || auditStatus == '2')
                  carBodyColorShow = true
              }
            "
            placeholder="请选择车辆颜色"
          />
          <u-select
            v-model="carBodyColorShow"
            mode="single-column"
            :list="carBodyColorList"
            @confirm="carBodyColorConfirm"
          ></u-select>
        </u-form-item>
        <u-form-item
          label="车轴数"
          class="form-item-box"
          required
          prop="carAxisLabel"
        >
          <u-input
            v-model="form.carAxisLabel"
            type="select"
            @click="
              {
                if (auditStatus == null || auditStatus == '2')
                  carAxisShow = true
              }
            "
            placeholder="请选择车轴数"
          />
          <u-select
            v-model="carAxisShow"
            mode="single-column"
            :list="carAxisList"
            @confirm="carAxisConfirm"
          ></u-select>
        </u-form-item>
        <u-form-item
          label="燃料类型"
          class="form-item-box"
          required
          prop="carFuelLabel"
        >
          <u-input
            v-model="form.carFuelLabel"
            type="select"
            @click="
              {
                if (auditStatus == null || auditStatus == '2')
                  carFuelShow = true
              }
            "
            placeholder="请选择燃料类型"
          />
          <u-select
            v-model="carFuelShow"
            mode="single-column"
            :list="carFuelList"
            @confirm="carFuelConfirm"
          ></u-select>
        </u-form-item>
      </view>
      <view class="card-box">
        <view class="u-flex"
          >挂靠协议<view class="card-icon-box">
            <view></view>
            <view></view> </view
        ></view>
        <view class="u-flex top-box">
          <u-form-item class="width-50" label-position="top">
            <u-upload
              :deletable="
                auditStatus == '2' || auditStatus === null ? true : false
              "
              :upload-text="'添加挂靠协议'"
              :width="325"
              :height="240"
              :custom-btn="true"
              class="uUpload-box"
              ref="uUpload7"
              :action="uploadUrl1"
              @on-success="leasingAgreementPicsuccess"
              @on-remove="leasingAgreementPicremove"
              @on-error="testerror"
              :show-progress="form.leasingAgreementPic ? false : true"
              max-count="1"
              :form-data="uploaderData"
            >
              <view
                slot="addBtn"
                class="slot-btn"
                hover-class="slot-btn__hover"
                hover-stay-time="150"
              >
                <view class="slot-name">添加挂靠协议</view>
              </view>
            </u-upload>
            <image
              v-if="leasingAgreementEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 10rpx;
              "
            />
            <div
              v-if="
                leasingAgreementPicRemoveFlag &&
                form.leasingAgreementPic &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('挂靠协议')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 120rpx;
                    left: 0rpx;
                  "
                />
              </div>
            </div>
            <div
              v-if="
                leasingAgreementPicRemoveFlag &&
                form.leasingAgreementPic &&
                auditStatus != null &&
                auditStatus == '0'
              "
              class="toexamine-box"
            >
              <image
                :src="uploadIconList[3].icon"
                style="
                  width: 98rpx;
                  height: 96rpx;
                  display: inline;
                  position: absolute;
                  bottom: 142rpx;
                  left: 0rpx;
                "
              />
            </div>
          </u-form-item>
        </view>
      </view>
    </u-form>

    <u-button
      type="primary"
      throttle-time="0"
      v-if="auditStatus == null || auditStatus == '2'"
      @click="validateRepeatBinding"
      class="vehiclemanagement-index-btn"
      >提交</u-button
    >
    <AlertModal
      :showModal="showAffiliationAgreementModal"
      :desc="'挂靠公司的车辆，请上传挂靠协议'"
      :showCancel="false"
      @confirm="handleAffiliationAgreementConfirm"
    >
    </AlertModal>
    <u-modal
      v-model="showModal"
      :width="'560'"
      :show-confirm-button="false"
      :show-title="false"
      @confirm="handleConfirm"
      @cancel="handleCancel"
      class="showModal-box"
    >
      <view style="padding: 30rpx">
        <view
          style="
            font-weight: bold;
            padding: 10rpx 0 0 20rpx;
            text-align: center;
          "
          >信息确认
        </view>
      </view>
      <view class="modal-content">
        <view class="section">
          <view class="title">
            <view class="title-text">车辆信息</view>
            <image src="../../static/title-icon.png" class="title-icon" />
          </view>
          <view class="content">
            <view class="item">
              <view class="item-name">车头车牌号：</view>
              <view class="item-desc">{{ submitObj.headNo }}</view>
            </view>
            <view class="item">
              <view class="item-name">挂车车牌号：</view>
              <view class="item-desc">{{ submitObj.attachNo }}</view>
            </view>
          </view>
        </view>
        <view class="section">
          <view class="title">
            <view class="title-text">附属资料</view>
            <image src="../../static/title-icon.png" class="title-icon" />
          </view>
          <view class="content">
            <view class="item">
              <view class="item-name">排放标准：</view>
              <view class="item-desc">{{ submitObj.carEmissionLabel }}</view>
            </view>
            <view class="item">
              <view class="item-name">车牌颜色：</view>
              <view class="item-desc">{{ submitObj.carPlateColorLabel }}</view>
            </view>
            <view class="item">
              <view class="item-name">车辆类型：</view>
              <view class="item-desc">{{ submitObj.carTypeLabel }}</view>
            </view>
            <view class="item">
              <view class="item-name">车辆车长：</view>
              <view class="item-desc">{{ submitObj.carLengthLabel }}</view>
            </view>
          </view>
        </view>
      </view>
      <view
        style="
          display: flex;
          justify-content: space-around;
          padding-bottom: 20rpx;
        "
      >
        <u-button
          type="primary"
          shape="circle"
          plain
          throttle-time="0"
          style="width: 224rpx"
          @click="handleCancel"
          >取 消
        </u-button>
        <u-button
          type="primary"
          shape="circle"
          :disabled="confirmTime > 0"
          style="width: 224rpx"
          @click="handleConfirm"
        >
          {{ `确定${confirmTime > 0 ? confirmTime + 's' : ''}` }}
        </u-button>
      </view>
    </u-modal>
    <!-- 用来提示 -->
    <u-toast ref="uToast" />
    <!-- 审核不通过提示信息 -->
    <u-modal v-model="repeatBindingShow" :width="'600'" :show-title="false">
      <view style="font-weight: bold; padding: 10rpx 0 0 20rpx">系统提示</view>
      <image
        src="https://minio.wskjwl.com/uipicture/bell.png"
        style="width: 100rpx; height: 120rpx; margin-left: 40%"
      />
      <view style="text-align: center; margin: 60rpx 0 80rpx 0">
        <view>该车辆已被绑定</view>
        <view>确认后将无法获得新人福利</view>
      </view>
      <view
        style="
          display: flex;
          justify-content: space-around;
          margin-bottom: 20rpx;
        "
      >
        <u-button
          type="primary"
          shape="circle"
          plain
          style="width: 35%"
          @click="repeatBindingShow = false"
          >取 消
        </u-button>
        <u-button
          type="primary"
          shape="circle"
          style="width: 35%"
          @click="submit"
          >确 定
        </u-button>
      </view>
    </u-modal>
  </view>
</template>
<script>
import AlertModal from './Modal.vue'
import httpEnum from './../../common/httpEnum.js'
import { v_integer } from './../../common/util.js'
export default {
  components: {
    AlertModal,
  },
  data() {
    // 牌号验证
    const carNoRuls = async (rule, value, callback) => {
      let reg =
        /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$)|([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/
      // let reg = /^[\u4e00-\u9fa5]{1}[A-Z]{1}[A-Z_0-9]{5}$/
      if (!value) {
        return callback(new Error('请输入车牌号'))
      } else if (!reg.test(value)) {
        return callback(new Error('请检查车牌号格式是否正确'))
      } else {
        callback()
      }
    }

    return {
      headLicenseRegisterAtShow: false,
      auditStatus: null,
      confirmTime: 6,
      showModal: false,
      repeatBindingShow: false,
      headLicense: false,
      attachLicenseEditable: false,
      headTransEditable: false,
      attachTransEditable: false,
      eProtectionSheetEditable: false,
      carPhotoEditable: false,
      headLicenseRemoveFlag: true,
      attachLicenseRemoveFlag: true,
      headTransRemoveFlag: true,
      leasingAgreementEditable: false,
      leasingAgreementPicRemoveFlag: true,
      attachTransRemoveFlag: true,
      eProtectionSheetRemoveFlag: true,
      carPhotoRemoveFlag: true,
      uploadUrl:
        httpEnum.baseUploadUrl +
        '/freight-business/ocr/recognize/vehicleLicense',
      uploadUrl1: httpEnum.baseUploadUrl + '/freight-business/file/app/upload',
      uploaderData1: {
        bucketName: 'logistics-control-platform',
        folderName: 'carPic',
        type: 1,
      },
      uploaderData2: {
        bucketName: 'logistics-control-platform',
        folderName: 'carPic',
        type: 2,
      },
      uploaderData: {
        bucketName: 'logistics-control-platform',
        folderName: 'carPic',
      },
      form: {
        carOwnerName: undefined, //车主姓名
        headNo: undefined, //车牌号
        attachNo: undefined, //挂车车牌号
        carType: undefined, //车型
        carTypeName: undefined, //车型1
        carEmission: undefined, //排放标准1
        carWeight: undefined, //车货总重
        ascriptionType: '0',
        headLicensePic: undefined, //车头行驶证,
        attachLicensePic: undefined, //挂车行驶证,
        headTransPic: undefined, //车头运输证,
        attachTransPic: undefined, //挂车运输证,
        environPic: undefined, //环保清单 ,
        carPic: undefined, //车辆照片 ,
        headLicenseNo: undefined, //车辆行驶证号码 ,
        headLicenseRegisterAt: undefined, //车辆行驶证注册时间 ,
        carEngineNo: undefined, //车辆发动机号 ,
        carVinNo: undefined, //车辆识别代号 ,
        carOwnerName: undefined, //车辆所属人 ,
        headTransNo: undefined, //经营许可证号 ,
        carBodyColor: undefined, //车辆颜色 ,
        carAxis: undefined, //车轴数 ,
        carFuel: undefined, //燃料类型 ,
        headTransSignName: undefined, //道路运输证签发机关
        headTransSignCode: undefined, //道路运输证签发机关code
        leasingAgreementPic: undefined, //挂靠协议
      },
      carTypeShow: false,
      carTypelist: [
        {
          label: '前四后八',
          value: '1',
        },
        {
          label: '平板',
          value: '2',
        },
        {
          label: '六轴双驱',
          value: '3',
        },
        {
          label: '半挂牵引车',
          value: '4',
        },
        {
          label: '前四后四',
          value: '5',
        },
        {
          label: '中型自卸货车',
          value: '6',
        },
        {
          label: '六轴单驱',
          value: '7',
        },
      ],
      headTransSignCodeShow: false, //道路运输证签发机关-开关
      emissionStandardsShow: false,
      emissionStandardslist: [
        // {
        //   label: '国五',
        //   value: '1',
        // },
        // {
        //   label: '国六',
        //   value: '2',
        // },
        // {
        //   label: '其他',
        //   value: '3',
        // },
        // {
        //   label: '新能源',
        //   value: '4',
        // },
      ],
      fuelTypeShow: false,
      fuelTypelist: [],
      fuelTypelist1: [
        {
          label: '天然气',
          value: '1',
        },
        {
          label: '柴油',
          value: '2',
        },
        {
          label: '电动',
          value: '3',
        },
        {
          label: '汽油',
          value: '4',
        },
        {
          label: '其他',
          value: '5',
        },
      ],
      rules: {
        headNo: [
          {
            required: true,
            validator: carNoRuls,
            trigger: ['change', 'blur'],
          },
        ],
        attachNo: [
          {
            required: true,
            validator: carNoRuls,
            trigger: ['change', 'blur'],
          },
        ],
        headLicenseRegisterAt: [
          {
            required: true,
            message: '请选择车头行驶证注册时间',
            trigger: ['change', 'blur'],
          },
        ],
        carEmissionLabel: [
          {
            required: true,
            message: '请选择排放标准',
            trigger: ['change', 'blur'],
          },
        ],
        carPlateColorLabel: [
          {
            required: true,
            message: '请选择车牌颜色',
            trigger: ['change', 'blur'],
          },
        ],
        carTypeLabel: [
          {
            required: true,
            message: '请选择车辆类型',
            trigger: ['change', 'blur'],
          },
        ],
        carLengthLabel: [
          {
            required: true,
            message: '请选择车辆长度',
            trigger: ['change', 'blur'],
          },
        ],
        headTransNo: [
          {
            required: true,
            message: '请输入经营许可证号',
            trigger: ['change', 'blur'],
          },
          {
            pattern: /(^\d{12}$)/,
            message: '请输入正确的经营许可证号',
            trigger: ['change', 'blur'],
          },
        ],
        headTransSignName: [
          {
            required: true,
            message: '请选择道路运输证签发机关',
            trigger: ['change', 'blur'],
          },
        ],
        carBodyColorLabel: [
          {
            required: true,
            message: '请选择车辆颜色',
            trigger: ['change', 'blur'],
          },
        ],
        carWeight: [
          {
            required: true,
            message: '请输入核定载重',
            trigger: ['change', 'blur'],
          },
          {
            pattern: /(^([1]{0,1})+([0-9]{1,2})+(.[0-9]{2})?|200$)/,
            message: '请输入正确核定载重',
            trigger: ['change', 'blur'],
          },
        ],
        carAxisLabel: [
          {
            required: true,
            message: '请选择车轴数',
            trigger: ['change', 'blur'],
          },
        ],
        carFuelLabel: [
          {
            required: true,
            message: '请选择燃料类型',
            trigger: ['change', 'blur'],
          },
        ],
      },
      maxSize: 1024 * 1024 * 4,
      uploadIconList: [
        {
          icon: 'https://minio.wskjwl.com/uipicture/correcticon.png',
          path: '/pages/vehiclemanagement/vehiclemanagement',
          title: '完成标识',
        },
        {
          icon: 'https://minio.wskjwl.com/uipicture/uploadpass.png',
          path: '/pages/login/register',
          title: '审核通过',
        },
        {
          icon: 'https://minio.wskjwl.com/uipicture/uploadreject.png',
          path: '/pages/login/register',
          title: '审核失败',
        },
        {
          icon: '../../static/my/audit-0.png',
          path: '/pages/login/register',
          title: '审核中',
        },
      ],
      carEmissionStandard: false,
      carLicensePlateColor: false,
      carTypeShow: false,
      carLengthShow: false,
      carEmissionStandardList: [],
      carLicensePlateColorList: [],
      carLengthList: [],
      carTypeList: [],
      submitObj: {},
      auditStatus: null,
      deletableTextList: [],
      carBodyColorShow: false,
      carBodyColorList: [],
      carAxisShow: false,
      carAxisList: [],
      carFuelShow: false,
      carFuelList: [],
      showAffiliationAgreementModal: false,
    }
  },
  onReady() {
    this.$refs.uForm.setRules(this.rules)
  },
  watch: {
    'form.headNo'(val, old) {
      this.upperCase(val, 'headNo')
    },
    'form.attachNo'(val, old) {
      this.upperCase(val, 'attachNo')
    },
  },
  onLoad() {
    Promise.all([
      this.getDictData('vehicle_type'),
      this.getDictData('vehicle_plate_color'),
      this.getDictData('vehicle_length'),
      this.getDictData('vehicle_emissions'),
      this.getDictData('vehicle_axis'),
      this.getDictData('vehicle_fuel'),
      this.getDictData('vehicle_body_color'),
    ]).then(() => {
      this.getDertailData()
    })
  },
  onShow() {
    this.getEmissionStandardsData()
  },
  mounted() {
    this.fuelTypelist = this.fuelTypelist1
  },
  methods: {
    submit() {},
    //道路运输证签发机关级联选择-确认
    pickerRegionSelect(val) {
      const { province, city, area } = val
      this.form.headTransSignCode =
        province.value + ',' + city.value + ',' + area.value
      this.form.headTransSignName =
        province.label + '' + city.label + '' + area.label
    },
    //道路运输证签发机关级联选择-取消
    pickerRegionCancelSelect() {
      this.headTransSignCodeShow = false
    },
    //审核存在判断
    toExamineIndexOf(val) {
      let tagFlag = undefined
      if (this.deletableTextList.indexOf(val) == -1) {
        tagFlag = false
      } else {
        tagFlag = true
      }
      return tagFlag
    },
    // 请求详情数据
    async getDertailData() {
      const { code, result, message } = await this.$u.get(
        '/freight-business/freightCar/driver/carDetail'
      )
      if (code === '0') {
        if (result) {
          this.auditStatus = result.auditStatus
          this.deletableTextList =
            result.auditRejectInfo && JSON.parse(result.auditRejectInfo)
          this.form.headNo = result.headNo
          this.form.headLicensePic = result.headLicensePic
          this.form.headTransPic = result.headTransPic
          this.form.attachNo = result.attachNo
          this.form.attachLicensePic = result.attachLicensePic
          this.form.attachTransPic = result.attachTransPic
          this.form.carPic = result.carPic
          this.form.leasingAgreementPic = result.leasingAgreementPic
          this.form.environPic = result.environPic
          this.form.carEmission = result.carEmission
          this.form.carPlateColor = result.carPlateColor
          this.form.carType = result.carType
          this.form.carLength = result.carLength
          this.form.carId = result.carId
          this.form.headTransNo = result.headTransNo
          this.form.carWeight = result.carWeight + ''
          this.form.headLicenseNo = result.headLicenseNo
          this.form.headLicenseRegisterAt =
            result.headLicenseRegisterAt &&
            result.headLicenseRegisterAt.split(' ')[0]
          this.form.carEngineNo = result.carEngineNo
          this.form.carVinNo = result.carVinNo
          this.form.carOwnerName = result.carOwnerName
          this.form.carOwnerName = result.carOwnerName
          this.form.carBodyColor = result.carBodyColor
          this.form.carAxis = result.carAxis
          this.form.carFuel = result.carFuel
          this.form.headTransSignName = result.headTransSignName
          this.form.headTransSignCode = result.headTransSignCode
          this.form.carEmissionLabel = this.carEmissionStandardList.find(
            (item) => result.carEmission == item.value
          ).label
          this.form.carPlateColorLabel = this.carLicensePlateColorList.find(
            (item) => result.carPlateColor == item.value
          ).label
          this.form.carTypeLabel = this.carTypeList.find(
            (item) => result.carType == item.value
          ).label
          this.form.carLengthLabel = this.carLengthList.find(
            (item) => result.carLength == item.value
          ).label
          this.form.carBodyColorLabel = this.carBodyColorList.find(
            (item) => result.carBodyColor == item.value
          ).label
          this.form.carAxisLabel = this.carAxisList.find(
            (item) => result.carAxis == item.value
          ).label
          this.form.carFuelLabel = this.carFuelList.find(
            (item) => result.carFuel == item.value
          ).label
          if (result.leasingAgreementPic) {
            this.$refs.uUpload7.lists = [
              {
                url:
                  httpEnum.baseImgUrl +
                  '/logistics-control-platform/' +
                  result.leasingAgreementPic,
              },
            ]
          }
          this.$refs.uUpload6.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/logistics-control-platform/' +
                result.carPic,
            },
          ]
          this.$refs.uUpload5.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/logistics-control-platform/' +
                result.environPic,
            },
          ]
          this.$refs.uUpload4.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/logistics-control-platform/' +
                result.attachTransPic,
            },
          ]
          this.$refs.uUpload3.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/logistics-control-platform/' +
                result.headTransPic,
            },
          ]
          this.$refs.uUpload2.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/logistics-control-platform/' +
                result.attachLicensePic,
            },
          ]
          this.$refs.uUpload1.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/logistics-control-platform/' +
                result.headLicensePic,
            },
          ]
        }
      }
    },
    carTypeListConfirm(val) {
      this.form.carTypeLabel = val[0].label
      this.form.carType = this.carTypeList.find(
        (item) => val[0].label == item.label
      ).value
    },
    carLengrhListConfirm(val) {
      this.form.carLengthLabel = val[0].label
      this.form.carLength = this.carLengthList.find(
        (item) => val[0].label == item.label
      ).value
    },
    CarDischargeConfirm(val) {
      this.form.carEmissionLabel = val[0].label
      this.form.carEmission = this.carEmissionStandardList.find(
        (item) => val[0].label == item.label
      ).value
    },
    carLicensePlateColorConfirm(val) {
      this.form.carPlateColorLabel = val[0].label
      this.form.carPlateColor = this.carLicensePlateColorList.find(
        (item) => val[0].label == item.label
      ).value
    },
    carBodyColorConfirm(val) {
      this.form.carBodyColorLabel = val[0].label
      this.form.carBodyColor = this.carBodyColorList.find(
        (item) => val[0].label == item.label
      ).value
    },
    carAxisConfirm(val) {
      this.form.carAxisLabel = val[0].label
      this.form.carAxis = this.carAxisList.find(
        (item) => val[0].label == item.label
      ).value
    },
    carFuelConfirm(val) {
      this.form.carFuelLabel = val[0].label
      this.form.carFuel = this.carFuelList.find(
        (item) => val[0].label == item.label
      ).value
    },
    // 查询字典
    async getDictData(type) {
      const { code, result, message } = await this.$u.get(
        `/freight-auth/dictValue/type/${type}`
      )
      // 车辆类型：vehicle_type_***
      // 车牌颜色：vehicle_plate_color_***
      // 车辆长度：vehicle_length_***
      // 排放标准：vehicle_emissions_***
      // 车轴数： vehicle_axis_***
      // 车辆燃料：vehicle_fuel_***
      // 车辆颜色：vehicle_body_color_***
      if (code === '0') {
        if (type == 'vehicle_type') {
          this.carTypeList = result.map((item) => {
            return {
              label: item.labelDefault,
              value: item.value,
            }
          })
        } else if (type == 'vehicle_plate_color') {
          this.carLicensePlateColorList = result.map((item) => {
            return {
              label: item.labelDefault,
              value: item.value,
            }
          })
        } else if (type == 'vehicle_length') {
          this.carLengthList = result.map((item) => {
            return {
              label: item.labelDefault,
              value: item.value,
            }
          })
        } else if (type == 'vehicle_emissions') {
          this.carEmissionStandardList = result.map((item) => {
            return {
              label: item.labelDefault,
              value: item.value,
            }
          })
        } else if (type == 'vehicle_axis') {
          this.carAxisList = result.map((item) => {
            return {
              label: item.labelDefault,
              value: item.value,
            }
          })
        } else if (type == 'vehicle_fuel') {
          this.carFuelList = result.map((item) => {
            return {
              label: item.labelDefault,
              value: item.value,
            }
          })
        } else if (type == 'vehicle_body_color') {
          this.carBodyColorList = result.map((item) => {
            return {
              label: item.labelDefault,
              value: item.value,
            }
          })
        }
      } else {
        this.$api.msg(message)
      }
    },
    //触发校验
    triggerSingleFieldValidate(refName) {
      this.$refs[refName].onFieldChange()
    },
    //字符串中小写转大写
    upperCase(str, key) {
      let arr = str.split('')
      let newStr = ''
      // 通过数组的forEach方法来遍历数组
      arr.forEach(function (value) {
        if (value >= 'a' && value <= 'z') newStr += value.toUpperCase()
        else newStr += value
      })
      this.form[key] = newStr
    },
    //屏蔽键盘
    hideKeyBorder(e) {
      uni.hideKeyboard()
    },
    handleheadLicenseRegisterAtConfirm(val) {
      this.form.headLicenseRegisterAt =
        val.year + '-' + val.month + '-' + val.day
    },
    //车头行驶证上传
    headLicensesuccess(data, index, lists, name) {
      const { result } = data
      if (data.code == '0') {
        this.form.headLicensePic = result.imgUrl
        this.form.headNo = result.licensePlateNumber
        this.form.headLicenseNo = result.vinCode
        this.form.headLicenseRegisterAt = result.registrationDate
        this.form.carEngineNo = result.engineNumber
        this.form.carVinNo = result.vinCode
        this.form.carOwnerName = result.owner
        setTimeout(() => {
          this.triggerSingleFieldValidate('headNo')
        })
        this.headLicense = true
      } else {
        this.$refs.uUpload1.lists = []
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
      }
    },
    //车头行驶证上传删除
    headLicenseremove(data, index, lists, name) {
      this.form.headLicensePic = ''
      this.headLicense = false
      this.headLicenseRemoveFlag = false
    },
    //挂车行驶证上传
    attachLicensesuccess(data, index, lists, name) {
      if (data.code == '0') {
        this.form.attachLicensePic = data.result.imgUrl
        this.form.attachNo = data.result.licensePlateNumber
        setTimeout(() => {
          this.triggerSingleFieldValidate('attachNo')
        })
        this.attachLicenseEditable = true
      } else {
        this.$refs.uUpload2.lists = []
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
      }
    },
    //挂车行驶证上传删除
    attachLicenseremove(data, index, lists, name) {
      this.form.attachLicensePic = ''
      this.attachLicenseEditable = false
      this.attachLicenseRemoveFlag = false
    },
    //车头运输证上传
    headTranssuccess(data, index, lists, name) {
      if (data.code == '0') {
        this.form.headTransPic = data.result
        this.headTransEditable = true
      } else {
        this.$refs.uUpload3.lists = []
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
      }
    },
    //车头运输证上传删除
    headTransremove(data, index, lists, name) {
      this.form.headTransPic = ''
      this.headTransEditable = false
      this.headTransRemoveFlag = false
    },
    //挂车运输证上传
    attachTranssuccess(data, index, lists, name) {
      if (data.code == '0') {
        this.form.attachTransPic = data.result
        this.attachTransEditable = true
      } else {
        this.$refs.uUpload4.lists = []
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
      }
    },
    //挂车运输证上传删除
    attachTransremove(data, index, lists, name) {
      this.form.attachTransPic = ''
      this.attachTransEditable = false
      this.attachTransRemoveFlag = false
    },
    //环保清单上传
    eProtectionSheetsuccess(data, index, lists, name) {
      if (data.code == '0') {
        this.form.environPic = data.result
        this.eProtectionSheetEditable = true
      } else {
        this.$refs.uUpload5.lists = []
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
      }
    },
    //环保清单上传删除
    eProtectionSheetremove(data, index, lists, name) {
      this.form.environPic = ''
      this.eProtectionSheetEditable = false
      this.eProtectionSheetRemoveFlag = false
    },
    //车辆照片上传
    carPhotosuccess(data, index, lists, name) {
      if (data.code == '0') {
        this.form.carPic = data.result
        this.carPhotoEditable = true
      } else {
        this.$refs.uUpload6.lists = []
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
      }
    },
    //车辆照片上传删除
    carPhotoremove(data, index, lists, name) {
      this.form.carPic = ''
      this.carPhotoEditable = false
      this.carPhotoRemoveFlag = false
    },
    //添加挂靠协议上传
    leasingAgreementPicsuccess(data, index, lists, name) {
      if (data.code == '0') {
        this.form.leasingAgreementPic = data.result
        this.leasingAgreementEditable = true
        this.leasingAgreementPicRemoveFlag = false
      } else {
        this.$refs.uUpload7.lists = []
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
      }
    },
    //添加挂靠协议删除
    leasingAgreementPicremove(data, index, lists, name) {
      this.form.leasingAgreementPic = ''
      this.leasingAgreementEditable = false
      this.leasingAgreementPicRemoveFlag = false
    },
    //上传失败
    testerror(res, index, lists, name) {
      this.$api.msg('上传失败')
    },
    // 提示
    showToast(title, type) {
      this.$refs.uToast.show({
        title,
        type: type || 'error',
      })
    },
    handleAffiliationAgreementConfirm() {
      this.showAffiliationAgreementModal = false
      this.postData()
    },
    async validateRepeatBinding() {
      console.log(this.form)
      this.$refs.uForm.validate(async (valid) => {
        if (valid) {
          if (this.form.leasingAgreementPic == '') {
            this.showAffiliationAgreementModal = true
          } else {
            this.postData()
          }
        } else {
          this.$api.msg('请填写相关信息')
        }
      })
    },
    getuserInfo() {
      this.showModal = true
      this.timer = setInterval(() => {
        this.confirmTime--
        if (this.confirmTime < 1) {
          clearInterval(this.timer)
        }
      }, 1000)
    },
    handleConfirm() {
      this.showModal = false
      this.confirmTime = 6
      let userInfo = uni.getStorageSync('userInfo')
      if (userInfo.carInfo == null) {
        this.submitData(this.submitObj)
      }
      if (userInfo.carInfo && userInfo.carInfo.carAuditStatus == 2) {
        this.submitEditData(this.submitObj)
      }
    },
    handleCancel() {
      this.confirmTime = 6
      clearInterval(this.timer)
      this.showModal = false
    },
    // 提交数据
    postData() {
      let data = this.form
      let photoList = [
        'headLicensePic',
        'attachLicensePic',
        'headTransPic',
        'attachTransPic',
        'environPic',
        'carPic',
      ]
      let tagShow = true
      photoList.forEach((item) => {
        if (!data[item] || data[item] == undefined) {
          tagShow = false
        }
      })
      let obj = {
        ...data,
      }
      this.submitObj = obj
      if (tagShow) {
        this.getuserInfo()
      } else {
        if (!this.form.headLicensePic) {
          return this.$api.msg('请上传车头行驶证')
        }
        if (!this.form.attachLicensePic) {
          return this.$api.msg('请上传挂车行驶证')
        }
        if (!this.form.headTransPic) {
          return this.$api.msg('请上传车头运输证')
        }
        if (!this.form.attachTransPic) {
          return this.$api.msg('请上传挂车运输证')
        }
        if (!this.form.environPic) {
          return this.$api.msg('请上传环保清单')
        }
        if (!this.form.carPic) {
          return this.$api.msg('请上传车辆照片')
        }
      }
    },
    // 车辆排放标准数组
    async getEmissionStandardsData() {
      const { code, result, message } = await this.$u.get(
        '/freight-auth/dictValue/type/vehicle_emissions'
      )
      if (code === '0') {
        this.emissionStandardslist = result.map((item) => {
          return {
            label: item.labelDefault,
            value: item.value,
          }
        })
      } else {
        this.$api.msg(message)
      }
    },
    // 车辆添加提交
    async submitData(val) {
      const { code, result, message } = await this.$u.post(
        '/freight-business/freightCar/car/addByDriver',
        val
      )
      if (code === '0') {
        this.$api.msg('车辆添加成功')
        this.auditStatus = 0
        setTimeout(() => {
          uni.navigateBack()
        }, 2000)
      } else {
        this.$api.msg(message)
      }
    },
    async submitEditData(val) {
      const { code, result, message } = await this.$u.post(
        '/freight-business/freightCar/car/editByDriver',
        val
      )
      if (code === '0') {
        this.$api.msg('信息完善成功')
        setTimeout(() => {
          uni.navigateBack()
        }, 2000)
      } else {
        this.$api.msg(message)
      }
    },
  },
}
</script>
<style lang="scss" scoped>
.content {
  background-color: rgb(238, 238, 239);
  padding: 16rpx;
  width: 100%;
  .showModal-box {
    ::v-deep .u-model {
      background-image: linear-gradient(#ffe5e5, #fff);
    }
  }

  .top-box {
    justify-content: space-between;
    .width-50 {
      position: relative;
      .toexamine-box {
        position: absolute;
        bottom: 30rpx;
        left: 10rpx;
        color: white;
        width: 50rpx;
        height: 50rpx;
        border-radius: 50%;
        font-size: 18rpx;
        display: flex;
        flex-direction: column;
        align-items: center;
        line-height: 22rpx;
      }
    }
  }
}
.form-title {
  font-weight: 600;
  font-size: 32rpx;
  padding: 16rpx 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.default-check {
  display: flex;
  color: #2979ff;
  font-size: 30rpx;
  // justify-content: space-between;
  align-items: center;
}
.vehiclemanagement-index-btn {
  width: 100%;
  margin-top: 60rpx;
}
.card-box {
  background: white;
  margin-top: 24rpx;
  border-radius: 10rpx;
  padding: 24rpx 24rpx 0;
  .card-title-box {
    font-size: 28rpx;
    font-weight: 600;
  }
  .card-icon-box {
    margin-left: 6rpx;
    position: relative;
    view:nth-child(1) {
      width: 20rpx;
      height: 20rpx;
      border-radius: 50%;
      background: #57a3ff;
      position: absolute;
      top: -12rpx;
      left: 10rpx;
      z-index: 1;
    }
    view:nth-child(2) {
      width: 20rpx;
      height: 20rpx;
      border-radius: 50%;
      background: #add3ff;
      position: absolute;
      top: -6rpx;
      left: 20rpx;
    }
  }
}
.uUpload-box {
  /deep/.u-list-item {
    // background-image: url('https://minio.wskjwl.com/uipicture/xingshizheng.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
  }
}
.modal-content {
  padding: 0 30rpx;
  .title {
    display: flex;
    align-items: center;
    margin-bottom: 24rpx;
    &-text {
      font-size: 28rpx;
      font-weight: 500;
      color: #000000;
      line-height: 40rpx;
    }
    &-icon {
      width: 27rpx;
      height: 25rpx;
      margin-left: 4rpx;
    }
  }
  .section {
    margin-bottom: 32rpx;
  }
  .item {
    display: flex;
    font-size: 28rpx;
    color: #333333;
    line-height: 40rpx;
    &-name {
      white-space: nowrap;
    }
    &-img {
      width: 313rpx;
      height: 202rpx;
      object-fit: cover;
    }
  }
}
.slot-btn {
  width: 325rpx;
  height: 240rpx;
  background: #ffffff;
  box-shadow: 0px 5rpx 20rpx 1px rgba(197, 202, 213, 0.25);
  border-radius: 4rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.slot-img {
  width: 168rpx;
  height: 112rpx;
  margin-bottom: 18rpx;
}
.slot-name {
  font-size: 24rpx;
  color: #858b9c;
  line-height: 32rpx;
}
</style>
